migrate 3 fbcode-only TARGETS dirs with placeholder BUCK siblings (#21066)#21066
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21066
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (1 Unrelated Failure)As of commit 68dfcc3 with merge base 7628aa6 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109082045. |
There was a problem hiding this comment.
Pull request overview
This PR continues the internal fbcode TARGETS → BUCK migration by moving fbcode-only build rules into per-directory targets.bzl files behind a define_common_targets(is_fbcode=...) gate, and replacing/adding BUCK files that call into those definitions (or updating existing BUCK files to use migration helpers).
Changes:
- Added
targets.bzlfiles containing the formerTARGETSdefinitions wrapped indefine_common_targets(is_fbcode=False). - Replaced placeholder/added
BUCKfiles that loadis_fbcode()and invokedefine_common_targets(...). - Removed legacy
TARGETSfiles from the migrated directories.
Reviewed changes
Copilot reviewed 65 out of 65 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/end2end/targets.bzl | New gated fbcode-only target definitions migrated from TARGETS. |
| test/end2end/TARGETS | Removed legacy fbcode-only build definitions. |
| test/end2end/BUCK | Replaced placeholder with a thin caller into targets.bzl gated by is_fbcode(). |
| extension/audio/targets.bzl | New gated fbcode-only target definitions migrated from TARGETS. |
| extension/audio/TARGETS | Removed legacy fbcode-only build definitions. |
| extension/audio/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| exir/verification/targets.bzl | New gated fbcode-only target definitions migrated from TARGETS. |
| exir/verification/TARGETS | Removed legacy fbcode-only build definitions. |
| exir/verification/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| exir/tests/targets.bzl | New gated fbcode-only test/library target definitions migrated from TARGETS. |
| exir/tests/TARGETS | Removed legacy fbcode-only build definitions. |
| exir/tests/BUCK | Replaced placeholder with a thin caller into targets.bzl gated by is_fbcode(). |
| exir/dialects/test/targets.bzl | New gated fbcode-only unittest target migrated from TARGETS. |
| exir/dialects/test/TARGETS | Removed legacy fbcode-only build definitions. |
| exir/dialects/test/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| exir/dialects/edge/test/targets.bzl | New gated fbcode-only unittest targets migrated from TARGETS. |
| exir/dialects/edge/test/TARGETS | Removed legacy fbcode-only build definitions. |
| exir/dialects/edge/test/BUCK | Replaced placeholder with a thin caller into targets.bzl gated by is_fbcode(). |
| exir/dialects/edge/spec/targets.bzl | New gated fbcode-only library/binary targets migrated from TARGETS. |
| exir/dialects/edge/spec/TARGETS | Removed legacy fbcode-only build definitions. |
| exir/dialects/edge/spec/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/qualcomm/targets.bzl | New gated fbcode-only example targets migrated from TARGETS. |
| examples/qualcomm/TARGETS | Removed legacy fbcode-only build definitions. |
| examples/qualcomm/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/models/resnet/targets.bzl | New gated fbcode-only model target(s) migrated into targets.bzl. |
| examples/models/resnet/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/models/qwen3/targets.bzl | New gated fbcode-only model target(s) migrated into targets.bzl. |
| examples/models/qwen3/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/models/qwen2_5/targets.bzl | New gated fbcode-only model target(s) migrated into targets.bzl. |
| examples/models/qwen2_5/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/models/phi_4_mini/targets.bzl | New gated fbcode-only model + converter binary targets migrated into targets.bzl. |
| examples/models/phi_4_mini/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/models/gemma4/tests/targets.bzl | New gated fbcode-only test target migrated into targets.bzl. |
| examples/models/gemma4/tests/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| examples/llm_pte_finetuning/targets.bzl | New gated fbcode-only example targets migrated from TARGETS. |
| examples/llm_pte_finetuning/TARGETS | Removed legacy fbcode-only build definitions. |
| examples/llm_pte_finetuning/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| devtools/size_analysis_tool/targets.bzl | New gated fbcode-only tool targets migrated from TARGETS. |
| devtools/size_analysis_tool/TARGETS | Removed legacy fbcode-only build definitions. |
| devtools/size_analysis_tool/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| devtools/pte_tool/tests/targets.bzl | New gated fbcode-only unittest target migrated from TARGETS. |
| devtools/pte_tool/tests/TARGETS | Removed legacy fbcode-only build definitions. |
| devtools/pte_tool/tests/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| devtools/intermediate_output_tap/tests/targets.bzl | New gated fbcode-only unittest targets migrated from TARGETS. |
| devtools/intermediate_output_tap/tests/TARGETS | Removed legacy fbcode-only build definitions. |
| devtools/intermediate_output_tap/tests/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| devtools/inspector/tests/targets.bzl | New gated fbcode-only unittest targets migrated from TARGETS. |
| devtools/inspector/tests/TARGETS | Removed legacy fbcode-only build definitions. |
| devtools/inspector/tests/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| devtools/backend_debug/tests/targets.bzl | New gated fbcode-only unittest target migrated from TARGETS. |
| devtools/backend_debug/tests/TARGETS | Removed legacy fbcode-only build definitions. |
| devtools/backend_debug/tests/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| backends/webgpu/test/targets.bzl | New gated fbcode-only test/library targets added in targets.bzl. |
| backends/webgpu/test/BUCK | Updated BUCK targets to use the migration helper macro (fbcode_target). |
| backends/vulkan/_passes/targets.bzl | New gated fbcode-only pass-library targets migrated from TARGETS. |
| backends/vulkan/_passes/TARGETS | Removed legacy fbcode-only build definitions. |
| backends/vulkan/_passes/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| backends/example/targets.bzl | New gated fbcode-only example backend targets migrated from TARGETS. |
| backends/example/TARGETS | Removed legacy fbcode-only build definitions. |
| backends/example/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| backends/cortex_m/targets.bzl | New gated fbcode-only backend targets added in targets.bzl. |
| backends/cortex_m/quantizer/targets.bzl | New gated fbcode-only quantizer targets migrated from TARGETS. |
| backends/cortex_m/quantizer/TARGETS | Removed legacy fbcode-only build definitions. |
| backends/cortex_m/quantizer/BUCK | New thin caller into targets.bzl gated by is_fbcode(). |
| backends/cortex_m/BUCK | Updated BUCK targets to use the migration helper macro (fbcode_target). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
| load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") | ||
| load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") |
| "fbsource//third-party/pypi/soundfile:soundfile" | ||
| ] | ||
| ) |
| load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
| load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") | ||
| load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
| load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_version") |
| python_unittest( | ||
| name = "test_add", | ||
| srcs = [ | ||
| "ops/add/test_add.py", |
| # Any targets that should be shared between fbcode and xplat must be defined in | ||
| # targets.bzl. |
| load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") | ||
| load(":targets.bzl", "define_common_targets") | ||
|
|
||
| oncall("executorch") |
| load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") | ||
| load(":targets.bzl", "define_common_targets") | ||
|
|
||
| oncall("executorch") |
7de0e3b to
2ae4fd7
Compare
…torch#21066) Summary: Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where: - TARGETS contained substantial fbcode-only build rules (`fbcode_macros`, `cpp_library`, `cpp_unittest`, etc.) - BUCK was a 4-5-line placeholder (e.g. "empty BUCK file to unblock landing") - No targets.bzl existed yet Same transform as chunk 6: created a new `targets.bzl` with the original loads and a `define_common_targets(is_fbcode = False)` function whose body opens with `if not is_fbcode: return`. Overwrote the placeholder BUCK with a thin caller that loads `fbsource_utils.is_fbcode()` and calls `define_common_targets(is_fbcode = is_fbcode())`. Directories migrated: - exir/dialects/edge/test - exir/tests - test/end2end Differential Revision: D109082045
…torch#21066) Summary: Pull Request resolved: pytorch#21066 Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where: - TARGETS contained substantial fbcode-only build rules (`fbcode_macros`, `cpp_library`, `cpp_unittest`, etc.) - BUCK was a 4-5-line placeholder (e.g. "empty BUCK file to unblock landing") - No targets.bzl existed yet Same transform as chunk 6: created a new `targets.bzl` with the original loads and a `define_common_targets(is_fbcode = False)` function whose body opens with `if not is_fbcode: return`. Overwrote the placeholder BUCK with a thin caller that loads `fbsource_utils.is_fbcode()` and calls `define_common_targets(is_fbcode = is_fbcode())`. Directories migrated: - exir/dialects/edge/test - exir/tests - test/end2end Differential Revision: D109082045
2ae4fd7 to
68dfcc3
Compare
| # Any targets that should be shared between fbcode and xplat must be defined in | ||
| # targets.bzl. | ||
|
|
||
| load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") | ||
| load(":targets.bzl", "define_common_targets") | ||
|
|
||
| oncall("executorch") | ||
|
|
||
| define_common_targets(is_fbcode = is_fbcode()) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
test/end2end/BUCK:9
# @noautodepswas present in the previous build file but is now missing from the BUCK file. This directive is typically consumed from the build file itself (see e.g. devtools/bundled_program/test/BUCK), so keeping it only inside targets.bzl likely won’t disable autodeps for this directory as intended.
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")
oncall("executorch")
define_common_targets(is_fbcode = is_fbcode())
| # @noautodeps | ||
|
|
||
|
|
||
|
|
Summary:
Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where:
(
fbcode_macros,cpp_library,cpp_unittest, etc.)Same transform as chunk 6: created a new
targets.bzlwith the originalloads and a
define_common_targets(is_fbcode = False)function whose bodyopens with
if not is_fbcode: return. Overwrote the placeholder BUCKwith a thin caller that loads
fbsource_utils.is_fbcode()and callsdefine_common_targets(is_fbcode = is_fbcode()).Directories migrated:
Differential Revision: D109082045